x86/spec-ctrl: Knobs for STIBP and PSFD, and follow hardware STIBP hint
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Jul 2022 09:13:33 +0000 (11:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Jul 2022 09:13:33 +0000 (11:13 +0200)
commitdb6ca8176ccc4ff7dfe3c06969af9ebfab0d7b04
tree8166eea3d454b3827786468fe27e0920ddf316ed
parent09d533f4c80b7eaf9fb4e36ebba8259580857a9d
x86/spec-ctrl: Knobs for STIBP and PSFD, and follow hardware STIBP hint

STIBP and PSFD are slightly weird bits, because they're both implied by other
bits in MSR_SPEC_CTRL.  Add fine grain controls for them, and take the
implications into account when setting IBRS/SSBD.

Rearrange the IBPB text/variables/logic to keep all the MSR_SPEC_CTRL bits
together, for consistency.

However, AMD have a hardware hint CPUID bit recommending that STIBP be set
unilaterally.  This is advertised on Zen3, so follow the recommendation.
Furthermore, in such cases, set STIBP behind the guest's back for now.  This
has negligible overhead for the guest, but saves a WRMSR on vmentry.  This is
the only default change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: fef244b179c06fcdfa581f7d57fa6e578c49ff50
master date: 2022-06-30 18:07:13 +0100
docs/misc/xen-command-line.pandoc
xen/arch/x86/hvm/svm/vmcb.c
xen/arch/x86/spec_ctrl.c